﻿<%@ Page Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="AC_ActivityTypes.aspx.cs" Inherits="KPIS.GERP.GHRMS.APP.App_UI.Forms.AC_ActivityTypes" %>
<%@ Register src="../Controls/user.ascx" tagname="user" tagprefix="uc1" %>

<asp:Content ID="Content1" runat="server" contentplaceholderid="ContentPlaceHolder1">  

  <link href="../../Styles/CssClass.css" rel="stylesheet" type="text/css" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">        
            <script type="text/javascript">
                function onTextChange(sender) {
                    if (sender.get_value() == "") {
                        sender.set_text("");
                    }
                }                                
            </script>       
    </telerik:RadCodeBlock>
      
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel6">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel6" LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>    
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
    </telerik:RadAjaxLoadingPanel>
    <asp:panel ID="Panel6" runat="server" >
        <table width="1000" cellpadding="0" cellspacing="0">
            <tr>
                <td valign = "top">
                    
                   <!-- <uc1:user ID="user1" runat="server" /> -->
                    
                </td>
                <td width="20" >
                </td>                
              </tr>
              <tr>
                  <td colspan = "3">
                    <div class="moduleDivSlim1000x450">
                    <div class="moduleDivBottom1000">
                    <table align="center" width="980px">
                    <tr>
                        <td align="left" class="tableHeader">
                            ประเภทกิจกรรม</td>
                    </tr>
                    </table>
                    <table align="center" style="height:390px; width: 964px;">
                    <tr align="center">
                        <td>
                        <asp:Panel ID="PanelGrid" 
                            runat="server" 
                            Height="390px" 
                            Width="980px" 
                            ScrollBars="Auto" >
                                <telerik:RadGrid ID="RadGrid1" 
                                    runat="server"
                                    AllowAutomaticDeletes="True" 
                                    AllowFilteringByColumn="True" 
                                    AllowMultiRowEdit="True" 
                                    AllowMultiRowSelection="True" 
                                    AllowPaging="True" 
                                    AllowSorting="True" 
                                    AutoGenerateColumns="False" 
                                    EnableAJAX="True" 
                                    EnableAJAXLoadingTemplate="True"
                                    GridLines="None" 
                                    Height="380px"
                                    Width="965px" 
                                    Skin="Outlook"
                                    OnItemCommand="RadGrid1_ItemCommand">
                                    <MasterTableView 
                                        AllowMultiColumnSorting="True" 
                                        CellSpacing="-1" 
                                        ClientDataKeyNames="Sequence" 
                                        CommandItemDisplay="Top" 
                                        DataKeyNames="Sequence"                                         
                                        NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                                        <CommandItemTemplate>
                                            <table width="100%">
                                                <tr>
                                                    <td align="left">
                                                        <asp:LinkButton ID="AddInstitute"
                                                                runat="server" 
                                                                CommandName="AddData"
                                                                Visible="true">
                                                                <img style="border:0px;vertical-align:middle;" alt=""
                                                                src="../Images/Buttons/AddRecord.gif" /> เพิ่มรายการประเภทกิจกรรม
                                                               
                                                        </asp:LinkButton>  
                                                    </td>
                                                    <td align="right">
                                                    </td>
                                                </tr>
                                            </table>
                                        </CommandItemTemplate>                                                                           
                                        <Columns>
                                            <telerik:GridTemplateColumn  
                                                HeaderStyle-Width="20px"                                                             
                                                HeaderStyle-HorizontalAlign="Center"
                                                ShowFilterIcon="false"
                                                AllowFiltering="false">                                                        
                                                <ItemTemplate>
                                                    <table>
                                                        <asp:ImageButton 
                                                            ID="cmdEdit" 
                                                            runat="server" 
                                                            CommandName="DataEdit"
                                                            OnClientClick="javascript: return confirm('แก้ไขข้อมูลที่เลือก?');"
                                                            ImageUrl="../Images/Buttons/Edit.gif" 
                                                            ToolTip="แก้ไขรายการ" 
                                                            width="20px" />
                                                    </table>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridTemplateColumn  
                                                HeaderStyle-Width="20px"                                                             
                                                HeaderStyle-HorizontalAlign="Center" 
                                                ShowFilterIcon="false"
                                                AllowFiltering="false">
                                                <ItemTemplate>
                                                    <table>
                                                        <asp:ImageButton 
                                                            ID="cmdDelete" 
                                                            runat="server" 
                                                            CommandName="Delete"
                                                            OnClientClick="javascript: return confirm('ลบข้อมูลที่เลือก?');"
                                                            ImageUrl="../Images/Buttons/Delete.gif" 
                                                            ToolTip="ลบรายการ" 
                                                            width="20px" />
                                                    </table>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" Width="20px" />
                                            </telerik:GridTemplateColumn> 
                                                                                                                 
                                            <telerik:GridBoundColumn DataField="Sequence" HeaderText="รหัส" 
                                                DataType="System.Int32" 
                                                Display="False"  
                                                ReadOnly="True" 
                                                UniqueName="Sequence" 
                                                Visible="True">
                                            </telerik:GridBoundColumn>
                                            
                                            <telerik:GridBoundColumn DataField="Name" 
                                                HeaderText="ประเภทกิจกรรม" 
                                                ShowFilterIcon="false"
                                                FilterControlWidth="100%"
                                                CurrentFilterFunction="Contains"
                                                AutoPostBackOnFilter="true"
                                                UniqueName="Name">
                                                <HeaderStyle Wrap="False" HorizontalAlign="Center" />
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                            
                                            <telerik:GridBoundColumn DataField="remark" 
                                                HeaderText="หมายเหตุ" 
                                                ShowFilterIcon="false"
                                                FilterControlWidth="100%"
                                                CurrentFilterFunction="Contains"
                                                AutoPostBackOnFilter="true"
                                                UniqueName="remark">
                                                <HeaderStyle Wrap="False" HorizontalAlign="Center" Width="350px" />
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                    </MasterTableView>
                                    <ClientSettings
                                        AllowColumnHide="True" 
                                        AllowColumnsReorder="True" 
                                        EnableRowHoverStyle="True"
                                        ReorderColumnsOnClient="True">
                                        <Selecting AllowRowSelect="true" EnableDragToSelectRows="true"/>
                                        <Scrolling AllowScroll="true" UseStaticHeaders="True" />
                                    </ClientSettings>
                                </telerik:RadGrid>
                            </asp:Panel>
                            
                            <asp:Panel ID="PanelAddData" 
                                runat="server"
                                Height="380px"
                                Visible="false" 
                                width="980px" 
                                align="center">
                                    <ul class="formList890px">
                                         <li>
                                            <table width="980px" align="center" >
                                                <tr>
                                                    <td align="left" class="tableDetailHeader" style="width: 980px">
                                                        ข้อมูลประเภทกิจกรรม
                                                    </td>
                                                </tr>
                                            </table>
                                        </li>
                                        <li>
                                            <table style="width: 980px">
                                            <tr>
                                                <td>
                                                    <telerik:RadTextBox ID="txtActivityTypeSeq" runat="server" Visible="false" Width="300px"/>
                                                </td>
                                            </tr>
                                            <tr>  
                                                <td align="right" style="width: 200px">
                                                    ประเภทกิจกรรม :
                                                </td>                                                 
                                                <td align="left">                                                    
                                                    <telerik:RadTextBox ID="txtActivityType" runat="server" Width="300px" />
                                                    <span class="validate">*</span>
                                                    <asp:RequiredFieldValidator runat="server" 
                                                        ID="RequiredFieldValidator1" 
                                                        ControlToValidate="txtActivityType"
                                                        ErrorMessage="กรุณากรอกข้อมูลประเภทกิจกรรม" >
                                                    </asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>  
                                                <td align="right" style="width: 200px">
                                                    หมายเหตุ :
                                                </td>                                                 
                                                <td align="left">                                                    
                                                    <telerik:RadTextBox ID="txtRemark" runat="server" Width="350px" Height="30px" />                                                    
                                                </td>
                                            </tr>
                                            </table>  
                                                                                    
                                            <table width="600px">
                                            <tr>
                                                <td align="left">                                        
                                                    <asp:Label ID="lblError" runat="server" ForeColor="Red" Font-Size="Small" Font-Bold="true" />
                                                </td>                                     
                                            </tr>
                                            </table>
                                        </li>
                                    </ul>                                                                           
                                  <table style="width: 646px">
                                    <tr>                                    
                                    <td align="right" style="width: 321px">
                                        <asp:Button ID="btnSave" onclick="btnSave_Click" runat="server" CssClass="button" Text="บันทึก" Width="80px" />   
                                        <asp:Button ID="btnUpdate" onclick="btnUpdate_Click" runat="server" CssClass="button" Visible="false" Text="แก้ไข" Width="80px" />                         
                                    </td>
                                    <td align="left">
                                        <asp:Button ID="btnCancel" OnClick="btnCancel_Click" runat="server" CssClass="button" Text="ยกเลิก" Width="80px" CausesValidation="false" />
                                    </td>
                                    </tr>
                                </table>
                            </asp:Panel>
                        </td>
                    </tr>
                    </table>
                    </div>
                 </div>
                </td>
    </tr>
    </table>
    </asp:panel>
</asp:Content>